package com.szxy.item.controller;

import com.szxy.item.service.ItemDescService;
import com.szxy.pojo.TbItemDesc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther:zwer
 * @Date:2019/9/7 19:51
 * @Description:com.szxy.item.controller
 * @Version:1.0
 **/
@RestController
@RequestMapping("/service/itemDesc")
public class ItemDescController {

    @Autowired
    private ItemDescService itemDescService;

    /**
     * 增加商品描述
     * @param itemDesc
     * @return
     */
    @PostMapping("/insertItemDesc")
    public Integer insertItemDesc(@RequestBody TbItemDesc itemDesc){
        return  this.itemDescService.insertItemDesc(itemDesc);
    }

    /**
     * 查找商品描述
     * @param itemId 商品 ID
     * @return
     */
    @GetMapping("/findItemDescByItemId")
    public TbItemDesc findItemDescByItemId(@RequestParam Long itemId){
        return this.itemDescService.findItemDescByItemId(itemId);
    }

    @PostMapping("/updateItemDescByItemId")
    int updateItemDescByItemId(@RequestBody TbItemDesc itemDesc){
        return this.itemDescService.updateItemDescByItemId(itemDesc);

    }

}


